//
//  STCommodityMobileSectionModel.swift
//  StarTimesON
//
//  Created by Toj on 8/19/22.
//  Copyright © 2022 StarTimes. All rights reserved.
//

import UIKit

enum STCommodityMobileSectionType: Int {
    case serviceAgreement = 1 // 0000 0000 0001 = 1
    // 规格
    case commodity                 = 16  // 0000 0001 0000 = 16 // 规格类型 17 - 31
    case commodityDataFree         = 17  // 0000 0001 0001 = 17  // 捆绑
    case commodityDataSave         = 20  // 0000 0001 0100 = 20  // 会员包
    case commodityDataSaveLetValid = 21  // 0000 0001 0101 = 21  // 会员包固定有效期
    // 规格提示
    case commodityTips = 32 // 0000 0010 0000 = 32 // 规格商品提示

    // 权益
    case rights = 64 // 0000 0100 0000 = 64

    // 推荐
    case recommend        = 128 // 0000 1000 0000 = 128
    case recommendBundle  = 132 // 0000 1000 0100 = 132
    case recommendProduct = 136 // 0000 1000 1000 = 136

    // 规格支付渠道
    case payChannel = 256 // 0001 0000 0000 = 256 // 规格支付渠道

    var isCommodity: Bool {
        return ((rawValue & Self.commodity.rawValue) > 0)
    }
}

class STCommodityMobileSectionModel: STSectionModel {
    // 组类型
    public var type: STCommodityMobileSectionType = .commodity
    
    /** 显示的数据 */
    // 商品规格详情
    public var productViewModel: MBProductViewModel?
    // 商品规格提示
    public var commodityTips: MBCommodityDetailTipsModel?
    // 商品规格支付渠道
    public var commodityChannel: MBCommodityChannelsModel?
    
    // 权益
    public var rights: [MemberRightsDto]?
  
    // 推荐 - 商品
    public var products: [MemberProductDto]?
}
